package com.sirun.cn.fca.loader;

import com.tencent.cloud.iov.kernel.model.BaseResponse;

import cn.sirun.com.fca.account.loader.AccountFlowLoader;
import cn.sirun.com.fca.account.model.base.CarInfoDetailResponse;
import cn.sirun.com.fca.account.model.login.PersonalInfo;
import cn.sirun.com.fca.account.model.login.PersonalInfoRequest;
import cn.sirun.com.fca.personal.center.model.bean.CarListResponse;
import cn.sirun.com.fca.personal.center.repo.ProfileRepository;
import io.reactivex.Observable;
import io.reactivex.schedulers.Schedulers;

public class HomeLoader extends AccountFlowLoader {

    public Observable<BaseResponse<PersonalInfo>> getPersonalInfo(PersonalInfoRequest request) {
        return ProfileRepository.getInstance().getPersonalInfo(request)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<CarListResponse>> getCarList() {
        return ProfileRepository.getInstance().getCarList()
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<CarInfoDetailResponse>> getCarInfo(String din) {
        return ProfileRepository.getInstance().getCarInfoDetail(din)
                .subscribeOn(Schedulers.io());
    }
}
